package com.huo.pattern.dynamicproxy;

import java.lang.reflect.Proxy;

public class DynamicProxyTest {
    public static void main(String[] args) {
        Person person = new Children();
        DynamicProxy proxy = new DynamicProxy(person);
        Person p = (Person) Proxy.newProxyInstance(proxy.getClass().getClassLoader(),person.getClass().getInterfaces(),proxy);
        p.say("Baba");
    }
}
